﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Masters/WithoutPermBasic.Master" CodeBehind="ScanInStorage.aspx.cs" Inherits="PMS.UI.CM.ScanInStorage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        var BarCode = com.get.BarCode;
        var Id;
        $(function () {
            $("#SweepCode").focus();

            //Jquery监听扫码枪回车事件
            $("#SweepCode").keyup(function (event) {
                if (event.keyCode == 13) {
                    var code = $(this).val();
                    code = code.replace(/\n/g, "")
                    $(this).val("");
                    BarCode = code;
                    InStorage(code);
                }
            });

            if (BarCode != null) {
                InStorage(BarCode);
            }
        });

    </script>
    <script type="text/javascript">

        function LoadTableByBarCode(barCode) {
            $.ajax({
                type: "POST",
                dataType: "json",
                url: "/Logic/PM/BottleProductionAjax.aspx?method=GetBottleProductionById",
                data: { 'BarCode': barCode },
                success: function (data) {
                    
                    $("#form1").form("load", data);
                }
            });
        }

        function InStorage(barCode) {
            $.ajax({
                type: "POST",
                dataType: "json",
                url: "/Logic/CM/BottleDeliveryAjax.aspx?method=ScanInStorage",
                data: { 'BarCode': barCode },
                success: function (data) {
                    com.message(data.state, data.msg);
                    LoadTableByBarCode(barCode)
                }
            });
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceToorbar" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">

    <div style="height: 100%; overflow: auto">
        <div id="master" class="container_16" style="height: auto;">
            <form id="form1">
                <div class="grid_12 val" style="height: 100px">
                    <textarea id="SweepCode" name="Note" style="width: 900px; height: 80px" placeholder="该区域是扫码区域，扫码之后该气瓶则自动入库"></textarea>
                </div>
                <div class="clear"></div>
                <div id="title" class="grid_16" style="text-align: center">
                    <h1>气瓶信息</h1>
                </div>
                <div class="clear"></div>

                <div class="grid_4 lbl" style="text-align: right;">
                    流水号: 
                    <input type="text" id="SerialCode" name="SerialCode" disabled="disabled" />
                </div>

                <div class="grid_4 lbl" style="text-align: right;">
                    瓶号:
                    <input type="text" id="BottleCode" name="BottleCode" disabled="disabled" />
                </div>

                <div class="grid_4 lbl" style="text-align: right;">
                    使用单位: 
                    <input type="text" id="CustomerName" name="CustomerName" disabled="disabled" />
                </div>

                <div class="grid_4 lbl" style="text-align: right;">
                    生产单号: 
                    <input type="text" id="ProductOrderCode" name="ProductOrderCode" disabled="disabled" />
                </div>

                <div class="clear"></div>
                
                <div class="grid_4 lbl" style="text-align: right;">
                    气瓶状态 : 
                     <input type="text" class="easyui-combobox" id="State" name="State" disabled="disabled"  
                      data-options="valueField:'value',textField:'text',data:StaticCombo.BottleStateQuery,panelHeight:'auto'" />
                </div>

                <div class="grid_4 lbl" style="text-align: right;">
                    产品名称:
                    <input type="text" id="ProductName" name="ProductName"  disabled="disabled" />
                </div>

                <div class="grid_4 lbl" style="text-align: right;">
                    入库人: 
                    <input type="text" class="easyui-combobox" id="InStoragePersonID" name="InStoragePersonID" disabled="disabled"
                        data-options="valueField:'value',textField:'text',url:'/Logic/CommonAjax/UserRelateAjax.aspx?method=GetAllUserName',panelHeight:'auto'"  />
                </div>
                <div class="grid_4 lbl" style="text-align: right;">
                    入库时间: 
                    <input type="text" id="InStorageDate" name="InStorageDate" disabled="disabled" />
                </div>
            </form>
        </div>
    </div>
</asp:Content>
